package com.lry.basic.design_mode.strategy.s_enum;

public enum Cal {
    ADD("+"){
        public int exec(int a,int b){
            return a+b;
        }
    },
    SUB("-"){
        public int exec(int a,int b){
            return a-b;
        }
    };
    String value = "";

    public String getValue() {
        return value;
    }

    private Cal(String value) {
        this.value = value;
    }

    public abstract int exec(int a, int b);

    public static void main(String[] args) {
        System.out.println(Cal.ADD.exec(1, 2));
    }
}
